﻿package  com.calefk.core {
	
	import flash.display.MovieClip;
	import com.calefk.util.Generic;
	/**
	 * Clase simple no posse el parametro profundidad
	 */
	public class EntitySimple extends Entity {
		
		protected var mCanvas:MovieClip;
        
		public function EntitySimple(canvas:MovieClip , nameClip:String = null,
				px:Number = 0, py:Number = 0 , project:Project = null) {
			mCanvas = canvas;
			mProject = project;
			// obtiene el proyecto por defecto
			var pj:Project = project;
			if (pj == null) {
				pj = Project.instance;
			}
			mClip = (nameClip == null)?new MovieClip():pj.getMovie(nameClip);
		
			mClip.gotoAndStop(1);
			
			x = px;
			y = py;
			mCanvas.addChild(mClip);
			
		}
		
		override public function clean():void {
			super.clean();
			mCanvas.removeChild(mClip);
			mClip = null;
			mCanvas = null;
            mProject = null;
		}
	}
}